﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.项目成果管理.service;
using DevExpress.XtraGrid.Demos.util;

namespace DXApplicationTangche.UC.项目成果管理
{
    public partial class Form在制品仅记录 : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        private String code;
        private String styleId;
        private DTO项目成果提交 DTO项目成果提交 = new DTO项目成果提交();
        public Form在制品仅记录(String code)
        {
            InitializeComponent();
            this.code = code;
        }

        private void textBox扫描_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                this.styleId = this.textBox扫描.Text;
                this.textBox1.Text = this.styleId;
            }
        }

        private void barButtonItem提交_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (String.IsNullOrEmpty(this.styleId) || String.IsNullOrEmpty(this.code))
            {
                MessageBox.Show("无扫描信息");
                return;
            }
            this.DTO项目成果提交.batchNo = this.styleId;
            this.DTO项目成果提交.code = this.code;
            this.DTO项目成果提交.content = FunctionHelper.JsonSerialization(this.styleId);
            new Form项目成果提交(this.DTO项目成果提交).ShowDialog();
        }
    }
}